<template>  
    <div class="functionalArea">
        <!--<ynet-progress-bar class="mt10" :items="stepText" :itemIndex="stepIndex"></ynet-progress-bar>-->
        <fillinEdit v-if="stepIndex=='0'" @changeStep="changeStep" :fillinMsg="formData"></fillinEdit>
        <confirmEdit v-if="stepIndex=='1'" @changeStep="changeStep" :confirmMsg="formData"></confirmEdit>
        <resultEdit v-if="stepIndex=='2'" @changeStep="changeStep" :resultMsg="formData"></resultEdit>
        <div class="btnArea tac">
            <el-button type="primary" @click="back()">Return</el-button>
        </div>
    </div>
</template>

<script>
    import fillinEdit from './components/newAccountEdit_input'    //填充存入开立信息表单
    import confirmEdit from './components/newAccountEdit_confirm'    //交易确认页面
    import resultEdit from './components/newAccountEdit_result'    //交易完成页面
	export default {
		name:'newPhoneAccount_edit',
        props:['detailData'],
		components:{
            fillinEdit,
            confirmEdit,
            resultEdit
		},
		data(){
            return { 
                stepIndex: 0,
                formData: this.detailData
            }   
        },
        mounted(){
            let _this = this
            // _this.formData = _this.detailData
        },
		methods:{ 
            back(){
                this.$emit('back')
            },
            changeStep(index,formData){
                let _this = this
                if(index == '-1'){
                    _this.back()
                    return
                }
                _this.stepIndex = index
                if(formData) _this.formData = formData
                _this.$tools.scrollTop()
            },
		}
	}
</script>